package dk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ReturnData.ResponseData;

import dk.service.ApiService;

@RestController
@RequestMapping("/api")
public class NoticeController {
	@Autowired 
	ApiService apiservice;
@PostMapping("GetNoticeByPage")
public ResponseData  GetNoticeByPage(Integer pagenum,Integer count) {
	return  apiservice.GetNoticeByPage(pagenum,count);
}
@PostMapping("SearchNoticeByTitle")
public ResponseData SearchNoticeByTitle(String title,Integer pagenum,Integer count) {
	return apiservice.SearchNoticeByTitle(title,pagenum,count);
}
@PostMapping("AddNotice")
public ResponseData AddNotice(String title,String content) {
	return apiservice.AddNotice(title,content);
}
@PostMapping("GetNoticeByid")
public ResponseData GetNoticeByid(Integer id) {
	return apiservice.GetNoticeByid(id);
}
@PostMapping("EditNoticeByid")
public ResponseData EditNoticeByid(String title,String content,Integer id) {
	return apiservice.EditNoticeByid(title,content,id);
	
}
@PostMapping("DeleteNoticeByid")
public ResponseData DeleteNoticeByid(Integer id) {
	return apiservice.DeleteNoticeByid(id);
	}
}
